home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / fp.h < prev    next >
Encoding:
Text File  |  1995-07-06  |  27.0 KB  |  626 lines  |  [TEXT/MPS ]

  1. /*******************************************************************************
  2. *                                                                              *
  3. *      File fp.h   -   PowerPC and 68K Macintosh                               *
  4. *                                                                              *
  5. *      A collection of numerical functions designed to facilitate a wide       *
  6. *      range of numerical programming. It is modeled after the Floating-Point  *
  7. *      C Extensions (FPCE) proposed technical draft of the Numerical C         *
  8. *      Extensions Group's requirements (NCEG / X3J11.1).                       *
  9. *      The <fp.h> declares many functions in support of numerical programming. *
  10. *      It provides a superset of <math.h> and <sane.h> functions.  Some        *
  11. *      functionality previously found in <sane.h> and not in the FPCE <fp.h>   *
  12. *      can be found in this <fp.h> under the heading "__NOEXTENSIONS__".       *
  13. *                                                                              *
  14. *      All of these functions are IEEE 754 aware and treat exceptions, NaNs,   *
  15. *      positive and negative zero and infinity consistent with the floating-   *
  16. *      point standard.                                                         *
  17. *                                                                              *
  18. *      Copyright © 1992-1995 Apple Computer, Inc.  All rights reserved.        *
  19. *                                                                              *
  20. *      Written by Ali Sazegari, started on July 1992,                          *
  21. *      based on the file Numerics.h by Jim Thomas.                             *
  22. *                                                                              *
  23. *      October    27  1992: made changes for PowerPC, transfered some power    *
  24. *                           functions to <faux.h>.                             *
  25. *      October    30  1992: added long double data type for PowerPC and        *
  26. *                           merged it with the Macintosh <fp.h>.               *
  27. *      December   10  1992: changed logb, scalb, frexp and ldexp to            *
  28. *                           LOGB, SCALB, FREXP and LDEXP to avoid collision    *
  29. *                           with the ibm libc.                                 *
  30. *      December   16  1992: changed the flag "powerpc" to "powerc"             *
  31. *      February   17  1993: removed the typedefs and defrerred them to         *
  32. *                           <Types.h>.                                         *
  33. *      May        18  1993: added binary to decimal conversions for the        *
  34. *                           PowerPC.                                           *
  35. *      June       14  1993: added the long double decimal conversions, changed *
  36. *                           the decimal conversion prototypes to double_t.     *
  37. *      July       11  1993: changed the names of the long double bin2dec.      *
  38. *      August     23  1993: included C++ extern "C" wrappers to make them C++  *
  39. *                           friendly.                                          *
  40. *      November   29  1993: corrected a spelling mistake in the comments.      *
  41. *      February   22  1994: modf changed to double_t for 68K compatability PAF *
  42. *      February   22  1994: Comment changes PAF                                *
  43. *      April      26  1994: #define SIGDIGLEN 20 for 68K PAF                   *
  44. *      April      28  1994: collected all powerpc specific calls, changed      *
  45. *                           DECIMAL_DIG to 17.                                 *             
  46. *      May         2  1994: Added dec2d prototype and function to fp68K.c      *
  47. *      May         4  1994: Added #ifndef powerc prototype for trunc           *
  48. *      June       23  1994: Changed __inf() prototype to double_t.             *
  49. *     January    17  1995: Remove C++ comments.  Use ConditionalMacros.h      *
  50. *      March      29  1995: Added definitions for 68k based transfer functions *
  51. *                           and MathLib v2 double to 68k long double transfer  *
  52. *                           functions.  Corrected some comments.               *
  53. *                                                                              *
  54. *******************************************************************************/
  55.  
  56. #ifndef __FP__
  57. #define __FP__
  58.  
  59. /*      efficient types are included in Types.h.                              */
  60.  
  61. #ifndef __TYPES__
  62. #include <Types.h>
  63. #endif
  64.  
  65. /*******************************************************************************
  66. *                              Define some constants.                          *
  67. *******************************************************************************/
  68.  
  69. #if          GENERATINGPOWERPC
  70. #define      LONG_DOUBLE_SIZE         16
  71. #elif       GENERATING68881
  72. #define      LONG_DOUBLE_SIZE         12
  73. #else
  74. #define      LONG_DOUBLE_SIZE         10
  75. #endif  
  76.  
  77. #define      DOUBLE_SIZE               8      
  78.  
  79. #define      HUGE_VAL                  __inf()
  80. #define      INFINITY                  __inf()
  81. #define      NAN                        nan("255")
  82.  
  83. /*    the macro DECIMAL_DIG is obtained by satisfying the constraint that the
  84.       conversion from double to decimal and back is the identity function.   */
  85.  
  86. #ifdef      GENERATINGPOWERPC
  87. #define      DECIMAL_DIG              17 /* does not exist for double-double */
  88. #else
  89. #define      DECIMAL_DIG              21
  90. #endif      
  91.  
  92. #ifdef __cplusplus
  93. extern "C" {
  94. #endif
  95. /*******************************************************************************
  96. *                            Trigonometric functions                           *
  97. *******************************************************************************/
  98.  
  99. double_t cos ( double_t x );
  100. double_t sin ( double_t x );
  101. double_t tan ( double_t x );
  102.  
  103. double_t acos ( double_t x );                /*  result is in [0,pi]          */
  104. double_t asin ( double_t x );                /*  result is in [-pi/2,pi/2]    */
  105. double_t atan ( double_t x );                /*  result is in [-pi/2,pi/2]    */
  106.  
  107. /*    atan2 computes the arc tangent of y/x in [-pi,pi] using the sign of
  108.       both arguments to determine the quadrant of the computed value.         */
  109.  
  110. double_t atan2 ( double_t y, double_t x );
  111.  
  112. /*******************************************************************************
  113. *                              Hyperbolic functions                            *
  114. *******************************************************************************/
  115.  
  116. double_t cosh ( double_t x );
  117. double_t sinh ( double_t x );
  118. double_t tanh ( double_t x );
  119.  
  120. double_t acosh ( double_t x );
  121. double_t asinh ( double_t x );
  122. double_t atanh ( double_t x );
  123.  
  124. /*******************************************************************************
  125. *                              Exponential functions                           *
  126. *******************************************************************************/
  127.  
  128. double_t exp ( double_t x );
  129.  
  130. /*    expm1 computes the base e exponential of the argument minus 1,
  131.       i. e., exp(x) - 1.  For small enough arguments, expm1 is expected
  132.       to be more accurate than the straight forward computation of exp(x) - 1.*/
  133.  
  134. double_t expm1  ( double_t x );
  135. double_t exp2  ( double_t x );
  136.  
  137. double_t frexp ( double_t x, int *exponent );
  138. double_t ldexp ( double_t x, int n );
  139.  
  140. double_t log ( double_t x );
  141. double_t log2 ( double_t x );
  142.  
  143. /*    log1p computes the base e logorithm of 1 plus the argument,
  144.       i. e., log (1+x).  For small enough arguments, log1p is expected
  145.       to be more accurate than the straightforward computation of log (1+x).  */
  146.  
  147. double_t log1p ( double_t x );
  148. double_t log10 ( double_t x ); 
  149.  
  150. /*    logb extracts the exponent of its argument, as a signed integral
  151.       value. A subnormal argument is treated as though it were first
  152.       normalized. Thus
  153.  
  154.       1 <= x * 2^( - Logb ( x ) ) < 2                                         */
  155.  
  156. double_t logb ( double_t x );
  157.  
  158. long double modfl ( long double x, long double *iptrl );
  159. double_t    modf  ( double_t x, double_t *iptr );  /* <- note NCEG difference */
  160. float       modff ( float x, float *iptrf );
  161.  
  162. /*    scalb computes x * 2^n efficently.  This is not normally done by
  163.       computing 2^n explicitly.                                               */
  164.  
  165. double_t scalb ( double_t x, long int n ); 
  166.  
  167. /*******************************************************************************
  168. *                     Power and absolute value functions                       *
  169. *******************************************************************************/
  170.  
  171. double_t fabs ( double_t x );
  172.  
  173. /*    hypot computes the square root of the sum of the squares of its
  174.       arguments, without undue overflow or underflow.                         */
  175.  
  176. double_t hypot ( double_t x, double_t y );
  177. double_t pow   ( double_t x, double_t y );
  178. double_t sqrt  ( double_t x );
  179.  
  180. /*******************************************************************************
  181. *                        Gamma and Error functions                             *
  182. *******************************************************************************/
  183.  
  184. double_t erf  ( double_t x );            /*   the error function              */
  185. double_t erfc ( double_t x );            /*   complementary error function    */
  186.  
  187. double_t gamma ( double_t x );
  188.  
  189. /*    lgamma computes the base-e logarithm of the absolute value of
  190.       gamma of its argument x, for x > 0.                                     */
  191.  
  192. double_t lgamma ( double_t x );
  193.  
  194. /*******************************************************************************
  195. *                        Nearest integer functions                             *
  196. *******************************************************************************/
  197.  
  198. double_t ceil  ( double_t x );
  199. double_t floor ( double_t x ); 
  200.  
  201. /*    the rint function rounds its argument to an integral value in floating
  202.       point format, honoring the current rounding direction.                  */
  203.  
  204. double_t rint ( double_t x );
  205.  
  206. /*    nearbyint differs from rint only in that it does not raise the
  207.       inexact exception. It is the nearbyint function recommended by the
  208.       IEEE floating-point standard 854.                                       */
  209.  
  210. double_t nearbyint ( double_t x );
  211.  
  212. /*    the function rinttol rounds its argument to the nearest long int using
  213.       the current rounding direction.
  214.       >>Note that if the rounded value is outside the range of long int, then
  215.       the result is undefined.                                                */
  216.  
  217. long int rinttol ( double_t x );
  218.  
  219. /*    the round function rounds the argument to the nearest integral value
  220.       in double format similar to the Fortran "anint" function.  That is:
  221.       add half to the magnitude and chop.                                     */
  222.  
  223. double_t round ( double_t x );
  224.  
  225. /*    roundtol is similar to the Fortran function nint or to the Pascal round
  226.       >>Note that if the rounded value is outside the range of long int, then
  227.       the result is undefined.                                                */
  228.  
  229. long int roundtol ( double_t round );
  230.  
  231. /*    trunc computes the integral value, in floating format, nearest to
  232.       but no larger in magnitude than its argument.                           */
  233.  
  234. #if  GENERATING68K
  235. /* necessary because trunc is implicitly declared this way when -elems881 is set */
  236. int      trunc ( double_t x );      /*  Round to integer in direction of zero */
  237. #else
  238. double_t trunc ( double_t x );
  239. #endif
  240.  
  241. /*******************************************************************************
  242. *                            Remainder functions                               *
  243. *******************************************************************************/
  244.  
  245. double_t fmod ( double_t x, double_t y );
  246.  
  247. /*    the following two functions compute the remainder.  remainder is required
  248.       by the IEEE 754 floating point standard. The second form correponds to the
  249.       SANE remainder; it stores into 'quotient' the 7 low-order bits of the
  250.       integer quotient x/y, such that -127 <= quotient <= 127.                */
  251.  
  252. double_t remainder ( double_t x, double_t y );
  253. double_t remquo    ( double_t x, double_t y, int *quo );
  254.  
  255. /*******************************************************************************
  256. *                             Auxiliary functions                              *
  257. *******************************************************************************/
  258.  
  259. /*    copysign produces a value with the magnitude of its first argument
  260.       and sign of its second argument. NOTE: the order of the arguments
  261.       matches the recommendation of the IEEE 754 floating point standard,
  262.       which is opposite from the SANE copysign function.                      */
  263.  
  264. double_t copysign ( double_t x, double_t y );
  265.  
  266. /*    the call 'nan ( "n-char-sequence" )' returns a quiet NaN with content
  267.       indicated through tagp in the selected data type format.                */
  268.  
  269. long double nanl ( const char *tagp );
  270. double      nan  ( const char *tagp );
  271. float       nanf ( const char *tagp );
  272.  
  273. /*    these compute the next representable value, in the type indicated,
  274.       after 'x' in the direction of 'y'.  if x == y then y is returned.       */
  275.  
  276. long double nextafterl ( long double x, long double y );
  277. double      nextafterd ( double x, double y );
  278. float       nextafterf ( float x, float y );
  279.  
  280. /*******************************************************************************
  281. *                              Inquiry macros                                  *
  282. *******************************************************************************/
  283.  
  284. enum NumberKind
  285.             {
  286.             FP_SNAN = 0,        /*      signaling NaN                         */
  287.             FP_QNAN,            /*      quiet NaN                             */
  288.             FP_INFINITE,        /*      + or - infinity                       */
  289.             FP_ZERO,            /*      + or - zero                           */
  290.             FP_NORMAL,          /*      all normal numbers                    */
  291.             FP_SUBNORMAL        /*      denormal numbers                      */
  292.             };
  293.  
  294. #define      fpclassify(x)    ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  295.                               __fpclassify  ( x ) :                            \
  296.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  297.                               __fpclassifyd ( x ) :                            \
  298.                               __fpclassifyf ( x ) )
  299.  
  300. /*    isnormal is non-zero if and only if the argument x is normalized.       */
  301.  
  302. #define      isnormal(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  303.                               __isnormal ( x ) :                               \
  304.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  305.                               __isnormald ( x ) :                              \
  306.                               __isnormalf ( x ) )
  307.  
  308. /*    isfinite is non-zero if and only if the argument x is finite.           */
  309.  
  310. #define      isfinite(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  311.                               __isfinite ( x ) :                               \
  312.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  313.                               __isfinited ( x ) :                              \
  314.                               __isfinitef ( x ) )
  315.  
  316. /*    isnan is non-zero if and only if the argument x is a NaN.               */
  317.  
  318. #define      isnan(x)         ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  319.                               __isnan ( x ) :                                  \
  320.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  321.                               __isnand ( x ) :                                 \
  322.                               __isnanf ( x ) )
  323.  
  324. /*    signbit is non-zero if and only if the sign of the argument x is
  325.       negative. this includes, NaNs, infinities and zeros.                    */
  326.  
  327. #define      signbit(x)       ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  328.                               __signbit ( x ) :                                \
  329.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  330.                               __signbitd ( x ) :                               \
  331.                               __signbitf ( x ) )
  332.  
  333. /*******************************************************************************
  334. *                      Max, Min and Positive Difference                        *
  335. *******************************************************************************/
  336.  
  337. /*    These extension functions correspond to the standard functions, dim
  338.       max and min.
  339.  
  340.       The fdim function determines the 'positive difference' between its
  341.       arguments: { x - y, if x > y }, { +0, if x <= y }.  If one argument is
  342.       NaN, then fdim returns that NaN.  if both arguments are NaNs, then fdim
  343.       returns the first argument.                                             */
  344.  
  345. double_t fdim ( double_t x, double_t y );
  346.  
  347. /*    max and min return the maximum and minimum of their two arguments,
  348.       respectively.  They correspond to the max and min functions in FORTRAN.
  349.       NaN arguments are treated as missing data.  If one argument is NaN and
  350.       the other is a number, then the number is returned.  If both are NaNs
  351.       then the first argument is returned.                                    */
  352.  
  353. double_t fmax ( double_t x, double_t y );
  354. double_t fmin ( double_t x, double_t y );
  355.  
  356. /*******************************************************************************
  357. *                                Constants                                     *
  358. *******************************************************************************/
  359.  
  360. extern const double_t pi;
  361.  
  362. /*******************************************************************************
  363. *                              Internal prototypes                             *
  364. *******************************************************************************/
  365.  
  366. long int __fpclassify  ( long double x ); 
  367. long int __fpclassifyd ( double x );
  368. long int __fpclassifyf ( float x );
  369.  
  370. long int __isnormal  ( long double x );
  371. long int __isnormald ( double x );
  372. long int __isnormalf ( float x );
  373.  
  374. long int __isfinite  ( long double x );
  375. long int __isfinited ( double x );
  376. long int __isfinitef ( float x );
  377.  
  378. long int __isnan  ( long double x );
  379. long int __isnand ( double x );
  380. long int __isnanf ( float x );
  381.  
  382. long int __signbit  ( long double x );
  383. long int __signbitd ( double x );
  384. long int __signbitf ( float x );
  385.  
  386. double_t __inf ( void );
  387.  
  388. /*******************************************************************************
  389. *                              Non NCEG extensions                             *
  390. *******************************************************************************/
  391.  
  392. #ifndef __NOEXTENSIONS__
  393.  
  394. /*******************************************************************************
  395. *                              Financial functions                             *
  396. *******************************************************************************/
  397.  
  398. /*    compound computes the compound interest factor "(1 + rate) ^ periods"
  399.       more accurately than the straightforward computation with the Power
  400.       function.  This is SANE's compound function.                            */
  401.  
  402. double_t compound ( double_t rate, double_t periods );
  403.  
  404. /*    The function annuity computes the present value factor for an annuity 
  405.       "( 1 - ( 1 + rate ) ^ ( - periods ) ) / rate" more accurately than the
  406.       straightforward computation with the Power function. This is SANE's 
  407.       annuity function.                                                       */
  408.  
  409. double_t annuity ( double_t rate, double_t periods );
  410.  
  411. /*******************************************************************************
  412. *                              Random function                                 *
  413. *******************************************************************************/
  414.  
  415. double_t randomx ( double_t *x );
  416.  
  417. /*******************************************************************************
  418. *                              Relational operator                             *
  419. *******************************************************************************/
  420.  
  421. typedef short relop;                         /*      relational operator      */
  422.  
  423. enum 
  424.       {
  425.       GREATERTHAN = ( ( relop ) ( 0 ) ),
  426.       LESSTHAN,
  427.       EQUALTO,
  428.       UNORDERED
  429.       };
  430.  
  431. relop relation ( double_t x, double_t y );
  432.  
  433. /*******************************************************************************
  434. *                         Binary to decimal conversions                        *
  435. *******************************************************************************/
  436.  
  437. #if    GENERATINGPOWERPC
  438. #define      SIGDIGLEN      36               /*    significant decimal digits */
  439. #else
  440. #define      SIGDIGLEN      20               /*    significant decimal digits */
  441. #endif
  442.  
  443. #define      DECSTROUTLEN   80               /* max length for dec2str output */
  444. #define      FLOATDECIMAL   ((char)(0))
  445. #define      FIXEDDECIMAL   ((char)(1))
  446.  
  447. /*    The decimal record type provides an intermediate unpacked form for
  448.       programmers who wish to do their own parsing of numeric input or
  449.       formatting of numeric output.                                           */
  450.     
  451. struct decimal 
  452.      {
  453.       char sgn;                              /*         sign 0 for +, 1 for - */
  454.       char unused;
  455.       short exp;                             /*              decimal exponent */
  456.       struct
  457.             {
  458.             unsigned char length;
  459.             unsigned char text[SIGDIGLEN];   /*            significant digits */
  460.             unsigned char unused;
  461.             }sig;
  462.       };
  463.  
  464. typedef struct decimal decimal;
  465.  
  466. /*    Each conversion to a decimal string is controlled by a decform
  467.       structure.  The style is either FLOATDECIMAL or FIXEDDECIMAL defined
  468.       above.  The value of digits is the number of significant digits for
  469.       FLOATDECIMAL.  The value of digits for FIXEDDECIMAL is the number of
  470.       digits to the right of the decimal point.                               */
  471.  
  472. struct decform 
  473.       {
  474.       char style;                            /*  FLOATDECIMAL or FIXEDDECIMAL */
  475.       char unused;
  476.       short digits;
  477.       };
  478.  
  479. typedef struct decform decform;
  480.  
  481. /*    Each conversion to a decimal record d via the function call num2dec is 
  482.       controlled by a decform record f (defined earlier), to a double_t x.    */
  483.  
  484. void num2dec ( const decform *f, double_t x, decimal *d );
  485.  
  486. /*    dec2num converts a decimal record d to a double_t value.                */
  487.  
  488. double_t dec2num ( const decimal *d );
  489.  
  490. /*    The MathLib formatter dec2str is controlled by a decform f.  Input d is
  491.       a decimal record.                                                       */
  492.  
  493. void dec2str ( const decform *f, const decimal *d, char *s );
  494.  
  495. /*    The function str2dec is the MathLib scanner.                            */
  496.  
  497. void str2dec ( const char *s, short *ix, decimal *d, short *vp ); 
  498.  
  499. /*    dec2d is similar to dec2num except a double is returned on 68k platforms*/
  500.  
  501. #if  GENERATING68K
  502. double dec2d ( const decimal *d );
  503. #endif
  504.  
  505. /*    dec2f is similar to dec2num except a float is returned.                 */
  506.  
  507. float dec2f ( const decimal *d );
  508.  
  509. /*    dec2s is similar to dec2num except a short is returned.                 */
  510.  
  511. short int dec2s ( const decimal *d );
  512.  
  513. /*    dec2l is similar to dec2num except a long is returned.                  */
  514.  
  515. long int dec2l  ( const decimal *d );
  516.  
  517. /*******************************************************************************
  518. *                    68k-only Transfer Function Prototypes                     *
  519. *******************************************************************************/
  520.  
  521. #if GENERATING68K
  522. #if GENERATING68881
  523.  
  524. void x96tox80 ( const long double *x, extended80 *x80 );
  525. void x80tox96 ( const extended80 *x80, long double *x );
  526.  
  527. #else
  528.  
  529. void x96tox80 ( const extended96 *x96, long double *x );
  530. void x80tox96 ( const long double *x, extended96 *x96 );
  531.  
  532. #endif      /* GENERATING68881   */
  533. #endif      /* GENERATING68K */
  534.  
  535. #endif      /* __NOEXTENSIONS__ */
  536.  
  537. /*******************************************************************************
  538. *                         PowerPC-only Function Prototypes                     *
  539. *******************************************************************************/
  540.  
  541. #if  GENERATINGPOWERPC
  542.  
  543. long double cosl ( long double x );
  544. long double sinl ( long double x );
  545. long double tanl ( long double x );
  546.  
  547. long double acosl ( long double x );          /*  result is in [0,pi]         */
  548. long double asinl ( long double x );          /*  result is in [-pi/2,pi/2]   */
  549. long double atanl ( long double x );          /*  result is in [-pi/2,pi/2]   */
  550. long double atan2l ( long double y, long double x );
  551.  
  552. long double coshl ( long double x );
  553. long double sinhl ( long double x );
  554. long double tanhl ( long double x );
  555.  
  556. long double acoshl ( long double x );
  557. long double asinhl ( long double x );
  558. long double atanhl ( long double x );
  559.  
  560. long double expl ( long double x );
  561. long double expm1l ( long double x );
  562. long double exp2l  ( long double x );
  563.  
  564. long double frexpl ( long double x, int *exponent );
  565. long double ldexpl ( long double x, int n );
  566.  
  567. long double logl ( long double x );
  568. long double log1pl ( long double x );
  569. long double log10l ( long double x ); 
  570. long double log2l ( long double x );
  571.  
  572. long double logbl ( long double x );
  573. long double scalbl ( long double x, long int n ); 
  574.  
  575. long double fabsl ( long double x );
  576. long double hypotl ( long double x, long double y );
  577. long double powl   ( long double x, long double y );
  578. long double sqrtl  ( long double x );
  579.  
  580. long double erfl  ( long double x );     /*   the error function              */
  581. long double erfcl ( long double x );     /*   complementary error function    */
  582. long double gammal ( long double x );
  583. long double lgammal ( long double x );
  584.  
  585. long double ceill  ( long double x );
  586. long double floorl ( long double x );
  587. long double rintl ( long double x );
  588. long double nearbyintl ( long double x );
  589. long int rinttoll ( long double x );
  590. long double roundl ( long double x );
  591. long int roundtoll ( long double round );
  592. long double truncl ( long double x );
  593. long double remainderl ( long double x, long double y );
  594. long double remquol    ( long double x, long double y, int *quo );
  595. long double copysignl ( long double x, long double y );
  596. long double fdiml ( long double x, long double y );
  597. long double fmaxl ( long double x, long double y );
  598. long double fminl ( long double x, long double y );
  599.  
  600. #ifndef __NOEXTENSIONS__
  601.  
  602. relop relationl ( long double x, long double y );
  603. void x80told ( const extended80 *x80, long double *x );
  604. void ldtox80 ( const long double *x, extended80 *x80 );
  605.  
  606. /*    MathLib v2 has two new transfer functions: x80tod and dtox80.  They can 
  607.       be used to directly transform 68k 80-bit extended data types to double
  608.       and back for PowerPC based machines without using the functions
  609.       x80told or ldtox80.  Double rounding may occur.                         */
  610.  
  611. double x80tod ( const extended80 *x80 );
  612. void dtox80   ( const double *x, extended80 *x80 );
  613.  
  614. void num2decl ( const decform *f, long double x, decimal *d );
  615. long double dec2numl ( const decimal *d );
  616.  
  617. #endif      /* __NOEXTENSIONS__ */
  618.  
  619. #endif      /* GENERATINGPOWERPC  */
  620.  
  621. #ifdef __cplusplus
  622. }
  623. #endif
  624.  
  625. #endif      /* __FP__          */
  626.